package com.bz.service.impl;

import com.bz.dao.IUserDao;
import com.bz.entity.User;
import com.bz.service.Userservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements Userservice {

    // 这个不是错误，以为没有构建，但实际已经构建，那么?在哪里构建的？
    @Autowired
    private IUserDao iUserDao;

    @Override
    public void save(User user) {
        user.setUid(33);
        iUserDao.save(user);

    }

    @Override
    public List<User> findAll() {

        return    iUserDao.findAll();
    }
}
